// 2. 继承
#include <iostream>
using namespace std;

// 基类
class Vehicle {
public:
    void start() {
        cout << "Vehicle started." << endl;
    }
};

// 派生类
class Car : public Vehicle {
public:
    void drive() {
        cout << "Car is driving." << endl;
    }
};

int main() {
    Car myCar;
    myCar.start();  // 继承自Vehicle
    myCar.drive();  // Car自己的方法
    return 0;
}
